package com.glsc.ngateway.platform.xxljob;

import com.glsc.ngateway.common.api.oaflow.feign.IFeignOaFlowService;
import com.glsc.ngateway.platform.service.dev.DevManageService;
import com.glsc.ngateway.platform.service.EventImproveService;
import com.glsc.ngateway.platform.service.UserService;
import com.glsc.ngateway.platform.service.gitee.GiteeService;
import com.glsc.ngateway.platform.service.itflow.schedule.PlatformSyncOaflowTask;
import com.glsc.ngateway.platform.service.other.SystemLicenseExpireService;
import com.glsc.ngateway.platform.service.vendor.VendorRateDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class XxlJob {

    @Resource
    private SystemLicenseExpireService systemLicenseExpireService;

    @Resource
    private UserService userService;

    @Resource
    private EventImproveService eventImproveService;

    @Autowired
    private IFeignOaFlowService oaFlowService;

    @Autowired
    private PlatformSyncOaflowTask platformSyncOaflowTask;

    @Resource
    private VendorRateDetailService vendorRateDetailService;

    @Resource
    private GiteeService giteeService;

    @Resource
    private DevManageService devManageService;
    
    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_timeEndNotify")
    public void timeEndNotify() {
        systemLicenseExpireService.timeEndNotify();
    }

    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_notifyEventImproveEnd")
    public void notifyEventImproveEnd() {
        eventImproveService.notifyEventImproveEnd(null);
    }

    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_syncAllIssueScheduled")
    public void syncAllIssueeScheduled() {
        giteeService.syncAllIssueScheduled();
    }

    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_syncGiteeIssu")
    public void syncGiteeIssuee() {
        giteeService.syncGiteeIssue();
    }

    /**
     * 创建gitee需求
     */
    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_createGiteeDemandAndTask")
    public void createGiteeDemandAndTask() {
        devManageService.createGiteeDemandAndTask();
    }

    /**
     * 获取gitee状态
     */
    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_syncGiteeState")
    public void syncGiteeState() {
        devManageService.syncGiteeState();
    }

    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_syncGiteeBranch")
    public void syncGiteeBranch() {
        devManageService.syncGiteeBranch();
    }

    @com.xxl.job.core.handler.annotation.XxlJob("XxlJob_syncDevManageCurrentNode")
    public void syncDevManageCurrentNode() {
        devManageService.syncDevManageCurrentNode();
    }

}
